<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" exclude-result-prefixes="xsl xe msxsl CM" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xe="http://www.CrossFactory.net/XmlEditor" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:ContentManager="http://www.CrossFactory.net/ContentManager/" xmlns:CM="http://www.CrossFactory.net/ContentManager/">
<xsl:import href="%URLGlobalXslt%" />
<xsl:output method="xml" version="1.0" omit-xml-declaration="yes" indent="no" />

  <xsl:template match="picture">
		<xsl:variable name="hr" select="CM:GetUrl($applicationPath, $xe:contentLanguage, $hierarchy, href/text())"/>
		<div>
			<xsl:call-template name="XmlEditorInfo" />
			<xsl:choose>
				<xsl:when test="wrap/text()='no' and hpos/text()='right'">
					<xsl:attribute name="class">alignright</xsl:attribute>
				</xsl:when>
				<xsl:when test="wrap/text()='no' and hpos/text()='center'">
					<xsl:attribute name="class">aligncenter</xsl:attribute>
				</xsl:when>
				<xsl:when test="wrap/text()='no' and hpos/text()='left'"> 
					<xsl:attribute name="class">alignleft</xsl:attribute>
				</xsl:when>
				<xsl:when test="wrap/text()='yes' and hpos/text()='right'">
					<xsl:attribute name="class">floatright</xsl:attribute>
				</xsl:when>
				<xsl:when test="wrap/text()='yes' and hpos/text()='center'">
					<xsl:attribute name="class">aligncenter</xsl:attribute>
				</xsl:when>
				<xsl:when test="wrap/text()='yes' and hpos/text()='left'">  
					<xsl:attribute name="class">floatleft</xsl:attribute>
				</xsl:when>
			</xsl:choose>
      <xsl:if test="string-length(linkanchor/text()) != 0">
        <a>
          <xsl:attribute name="name"><xsl:value-of select="linkanchor/text()"/></xsl:attribute>
          <img border="0" src="{$applicationPath}Images/Transp.gif" width="1" height="1" style="display:none" />
        </a>
      </xsl:if>
      <xsl:choose>
        <xsl:when test="string-length(href/text()) != 0 or string-length(linkuri/text()) != 0">
            <a>
				      <xsl:choose>
					      <xsl:when test="string-length(href/text()) != 0">
						      <xsl:call-template name="XmlEditorCancelClick">
							      <xsl:with-param name="tooltip"><xsl:value-of select="tooltip/text()" /></xsl:with-param>
						      </xsl:call-template>
						      <xsl:choose>
							      <xsl:when test="linkanchor[string-length(text()) != 0]">
								      <xsl:attribute name="href"><xsl:value-of select="$hr"/>#<xsl:value-of select="linkanchor/text()"/></xsl:attribute>
							      </xsl:when>
							      <xsl:otherwise>
								      <xsl:attribute name="href"><xsl:value-of select="$hr"/></xsl:attribute>
							      </xsl:otherwise>
						      </xsl:choose>
						      <xsl:attribute name="target"><xsl:value-of select="target" /></xsl:attribute>
					      </xsl:when>
					      <xsl:otherwise>
						      <xsl:if test="string-length(linkuri/text()) != 0">
							      <xsl:call-template name="XmlEditorCancelClick">
								      <xsl:with-param name="tooltip"><xsl:value-of select="tooltip/text()" /></xsl:with-param>
							      </xsl:call-template>
							      <xsl:attribute name="href"><xsl:value-of select="$applicationPath" />_SiteNote/WWW/GetFile.aspx?uri=<xsl:value-of select="$xe:documentProviderName" />:<xsl:value-of select="linkuri" /></xsl:attribute>
							      <xsl:attribute name="target"><xsl:value-of select="target" /></xsl:attribute>
						      </xsl:if>
					      </xsl:otherwise>
				      </xsl:choose>
				      <img>
					      <xsl:choose>
						      <xsl:when test="border/text()='no'">
							      <xsl:attribute name="class">noborder</xsl:attribute>
						      </xsl:when>
						      <xsl:otherwise>
							      <xsl:attribute name="class">imageborder</xsl:attribute>
						      </xsl:otherwise>
					      </xsl:choose>
					      <xsl:attribute name="src"><xsl:value-of select="$applicationPath" />_SiteNote/WWW/GetFile.aspx?uri=<xsl:value-of select="$xe:documentProviderName" />:<xsl:value-of select="uri"/></xsl:attribute>
					      <xsl:if test="string-length(height/text()) != 0">
						      <xsl:attribute name="height"><xsl:value-of select="height/text()" /></xsl:attribute>
					      </xsl:if>
					      <xsl:if test="string-length(width/text()) != 0">
						      <xsl:attribute name="width"><xsl:value-of select="width/text()"  /></xsl:attribute>
					      </xsl:if>
					      <xsl:if test="string-length(tooltip/text()) != 0">
						      <xsl:attribute name="alt"><xsl:value-of select="tooltip/text()"  /></xsl:attribute>
					      </xsl:if>
					      <xsl:if test="overuri">
						      <xsl:attribute name="onmouseover">this.src='<xsl:value-of select="$applicationPath" />_SiteNote/WWW/GetFile.aspx?uri=<xsl:value-of select="$xe:documentProviderName" />:<xsl:value-of select="overuri"/>';</xsl:attribute>
						      <xsl:attribute name="onmouseout">this.src='<xsl:value-of select="$applicationPath" />_SiteNote/WWW/GetFile.aspx?uri=<xsl:value-of select="$xe:documentProviderName" />:<xsl:value-of select="uri"/>';</xsl:attribute>
					      </xsl:if>
				      </img>
			      </a>
        </xsl:when>
        <xsl:otherwise>
          <img>
					      <xsl:choose>
						      <xsl:when test="border/text()='no'">
							      <xsl:attribute name="class">noborder</xsl:attribute>
						      </xsl:when>
						      <xsl:otherwise>
							      <xsl:attribute name="class">imageborder</xsl:attribute>
						      </xsl:otherwise>
					      </xsl:choose>
					      <xsl:attribute name="src"><xsl:value-of select="$applicationPath" />_SiteNote/WWW/GetFile.aspx?uri=<xsl:value-of select="$xe:documentProviderName" />:<xsl:value-of select="uri"/></xsl:attribute>
					      <xsl:if test="string-length(height/text()) != 0">
						      <xsl:attribute name="height"><xsl:value-of select="height/text()" /></xsl:attribute>
					      </xsl:if>
					      <xsl:if test="string-length(width/text()) != 0">
						      <xsl:attribute name="width"><xsl:value-of select="width/text()"  /></xsl:attribute>
					      </xsl:if>
					      <xsl:if test="string-length(tooltip/text()) != 0">
						      <xsl:attribute name="alt"><xsl:value-of select="tooltip/text()"  /></xsl:attribute>
					      </xsl:if>
					      <xsl:if test="overuri">
						      <xsl:attribute name="onmouseover">this.src='<xsl:value-of select="$applicationPath" />_SiteNote/WWW/GetFile.aspx?uri=<xsl:value-of select="$xe:documentProviderName" />:<xsl:value-of select="overuri"/>';</xsl:attribute>
						      <xsl:attribute name="onmouseout">this.src='<xsl:value-of select="$applicationPath" />_SiteNote/WWW/GetFile.aspx?uri=<xsl:value-of select="$xe:documentProviderName" />:<xsl:value-of select="uri"/>';</xsl:attribute>
					      </xsl:if>
				      </img>
        </xsl:otherwise>
      </xsl:choose>
            
			
		</div>
	</xsl:template>


<xsl:template match="section">
    <div>
      <xsl:if test="$xe:editionMode = 'true'">
        <xsl:attribute name="style">
          <xsl:text>padding-top:1px;padding-bottom:1px;</xsl:text>
        </xsl:attribute>
      </xsl:if>
      <xsl:choose>
        <xsl:when test="(not(margin) or margin/text()='yes') and colored/text()='yes' and tabulation/text()='no'">
          <xsl:attribute name="class">
            <xsl:text>section sectionColored sectionMargin</xsl:text>
          </xsl:attribute>
        </xsl:when>
        <xsl:when test="(not(margin) or margin/text()='yes') and colored/text()='yes' and tabulation/text()='yes'">
          <xsl:attribute name="class">
            <xsl:text>section sectionColored sectionIndent sectionMargin</xsl:text>
          </xsl:attribute>
        </xsl:when>
        <xsl:when test="(not(margin) or margin/text()='yes') and colored/text()='no' and tabulation/text()='yes'">
          <xsl:attribute name="class">
            <xsl:text>section sectionIndent sectionMargin</xsl:text>
          </xsl:attribute>
        </xsl:when>
        <xsl:when test="(not(margin) or margin/text()='yes') and colored/text()='no' and tabulation/text()='no'">
          <xsl:attribute name="class">
            <xsl:text>section sectionMargin</xsl:text>
          </xsl:attribute>
        </xsl:when>
        <xsl:when test="margin/text()='no' and colored/text()='yes' and tabulation/text()='no'">
          <xsl:attribute name="class">
            <xsl:text>section sectionColored</xsl:text>
          </xsl:attribute>
        </xsl:when>
        <xsl:when test="margin/text()='no' and colored/text()='yes' and tabulation/text()='yes'">
          <xsl:attribute name="class">
            <xsl:text>section sectionColored sectionIndent</xsl:text>
          </xsl:attribute>
        </xsl:when>
        <xsl:when test="margin/text()='no' and colored/text()='no' and tabulation/text()='yes'">
          <xsl:attribute name="class">
            <xsl:text>section sectionIndent</xsl:text>
          </xsl:attribute>
        </xsl:when>
        <xsl:when test="margin/text()='no' and colored/text()='no' and tabulation/text()='no'">
          <xsl:attribute name="class">
            <xsl:text>section</xsl:text>
          </xsl:attribute>
        </xsl:when>
      </xsl:choose>
      <xsl:call-template name="XmlEditorInfo" />
      <xsl:apply-templates select="anchor" />
      <xsl:apply-templates select="sectiontitle"/>
      <xsl:apply-templates select="bloc|linkmore|subtitle|spacer|picture|paragraph|html|textlist|list|file|horizontalline|video|section|flash|toplink|diaporama|form|silverlight"/>
      <div style="clear:both;height:1px;">
        <img src="{$applicationPath}Images/Transp.gif" width="1px" height="1px" style="display:none;" />
      </div>
    </div>
  </xsl:template>



<xsl:template match="silverlight">
    <xsl:variable name="silverlightId">
      <xsl:value-of select="CM:RandomId()"/>
    </xsl:variable>
    <div>
      <xsl:choose>
        <xsl:when test="./wrap/text()='no' and ./hpos/text()='right'">
          <xsl:attribute name="class">
            <xsl:text>vfsalignright</xsl:text>
          </xsl:attribute>
        </xsl:when>
        <xsl:when test="./wrap/text()='no' and ./hpos/text()='center'">
          <xsl:attribute name="class">
            <xsl:text>vfsaligncenter</xsl:text>
          </xsl:attribute>
        </xsl:when>
        <xsl:when test="./wrap/text()='no' and ./hpos/text()='left'">
          <xsl:attribute name="class">
            <xsl:text>vfsalignleft</xsl:text>
          </xsl:attribute>
        </xsl:when>
        <xsl:when test="./wrap/text()='yes' and ./hpos/text()='right'">
          <xsl:attribute name="class">
            <xsl:text>vfsfloatright</xsl:text>
          </xsl:attribute>
        </xsl:when>
        <xsl:when test="./wrap/text()='yes' and ./hpos/text()='center'">
          <xsl:attribute name="class">
            <xsl:text>vfsaligncenter</xsl:text>
          </xsl:attribute>
        </xsl:when>
        <xsl:otherwise>
          <xsl:attribute name="class">
            <xsl:text>vfsfloatleft</xsl:text>
          </xsl:attribute>
        </xsl:otherwise>
      </xsl:choose>
      <div>
        <xsl:attribute name="id">
          <xsl:value-of select="$silverlightId" />
        </xsl:attribute>
        <xsl:choose>
          <xsl:when test="$xe:editionMode = 'false'">
            <xsl:variable name="width">
              <xsl:choose>
                <xsl:when test="string-length(width/text()) != 0" >
                  <xsl:apply-templates select="width"/>
                </xsl:when>
                <xsl:otherwise>
                  <xsl:text>150</xsl:text>
                </xsl:otherwise>
              </xsl:choose>
            </xsl:variable>
            <xsl:variable name="height">
              <xsl:choose>
                <xsl:when test="string-length(height/text()) != 0" >
                  <xsl:apply-templates select="height"/>
                </xsl:when>
                <xsl:otherwise>
                  <xsl:text>200</xsl:text>
                </xsl:otherwise>
              </xsl:choose>
            </xsl:variable>
            <xsl:variable name="background">
              <xsl:choose>
                <xsl:when test="string-length(background/text()) != 0" >
                  <xsl:apply-templates select="background"/>
                </xsl:when>
                <xsl:otherwise>
                  <xsl:text>white</xsl:text>
                </xsl:otherwise>
              </xsl:choose>
            </xsl:variable>
            <xsl:variable name="autostart">
              <xsl:choose>
                <xsl:when test="autostart/text()='no'" >
                  <xsl:text>false</xsl:text>
                </xsl:when>
                <xsl:otherwise>
                  <xsl:text>true</xsl:text>
                </xsl:otherwise>
              </xsl:choose>
            </xsl:variable>
            <a href="http://go.microsoft.com/fwlink/?LinkID=124807" style="text-decoration: none;">
              <img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style: none"/>
            </a>
            <script language="javascript" type="text/javascript">
              WriteSilverlight("<xsl:value-of select="$silverlightId" />","<xsl:value-of select="fileuri"/>","<xsl:value-of select="$applicationPath" />","<xsl:value-of select="$width" />","<xsl:value-of select="$height" />","<xsl:value-of select="$autostart" />","<xsl:value-of select="$background" />");
            </script>
          </xsl:when>
          <xsl:otherwise>
            <table>
              <xsl:attribute name="style">
                <xsl:text>background-image:url('</xsl:text>
                <xsl:value-of select="$applicationPath" />
                <xsl:text>_SiteNote/Admin/Images/silverlightlogo.jpg');background-repeat:no-repeat;background-position:center;</xsl:text>
              </xsl:attribute>
              <xsl:choose>
                <xsl:when test="border/text()='no'">
                  <xsl:attribute name="class">
                    <xsl:text>noborder</xsl:text>
                  </xsl:attribute>
                </xsl:when>
                <xsl:otherwise>
                  <xsl:attribute name="class">
                    <xsl:text>videoborder</xsl:text>
                  </xsl:attribute>
                </xsl:otherwise>
              </xsl:choose>
              <xsl:attribute name="width">
                <xsl:apply-templates select="width"/>
              </xsl:attribute>
              <xsl:attribute name="height">
                <xsl:apply-templates select="height"/>
              </xsl:attribute>
              <tr>
                <td>
                  <xsl:call-template name="XmlEditorInfo" />
                  <p class="txtlist">
                    <xsl:if test="$xe:labels">
                      <xsl:value-of select="$xe:labels/label[name = 'novideobrowsemode']/*[name(.) = $xe:userLanguage]/text()"/>
                    </xsl:if>
                  </p>
                </td>
              </tr>
            </table>
          </xsl:otherwise>
        </xsl:choose>
      </div>
    </div>
  </xsl:template>

  
</xsl:stylesheet>

  

  